import requests
import time

_t_s_ = str(time.time()).replace('.','')[:13]
# 获取打卡记录
url_search_call = f'http://xg.hieu.edu.cn/content/tabledata/student/temp/zzdk?bSortable_0=false&bSortable_1=true&iSortingCols=1&iDisplayStart=1&iDisplayLength=39&iSortCol_0=1&sSortDir_0=desc&_t_s_={_t_s_}'

# 获取打卡选项信息（预定义）
url_get_call = f'http://xg.hieu.edu.cn/content/student/temp/zzdk/lastone?_t_s_={_t_s_}'
# 打卡
url_post_info = f'http://xg.hieu.edu.cn/content/student/temp/zzdk?_t_s_={_t_s_}'

headers = {
    'user-agent':'Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/46.0.2490.76 Mobile Safari/537.36 yiban_android/5.0.8',
    'cookie': 'JSESSIONID=2819FC2233D5D8BECB6402974D22EC79'
}
data = "dkdz=湖南省长沙市岳麓区麓谷街道膳当家黄焖鸡米饭(二店)湖南涉外经济学院&dkdzZb=112.872376%2C28.200982&dkly=lbs&dkd=湖南省长沙市&jzdValue=430000%2C430100%2C430104&jzdSheng.dm=430000&jzdShi.dm=430100&jzdXian.dm=430104&jzdDz=涉外西21_403&jzdDz2=湖南南县北岭村16小组&lxdh=19196169857&sfzx=1&sfzx1=在校&twM.dm=01&tw1=[35.0~37.2]正常&tw1M.dm=&tw11=&tw2M.dm=&tw12=&tw3M.dm=&tw13=&yczk.dm=01&yczk1=无症状&fbrq=&jzInd=0&jzYy=&zdjg=&fxrq=&brStzk.dm=01&brStzk1=身体健康、无异常&brJccry.dm=01&brJccry1=未接触传染源&jrStzk.dm=01&jrStzk1=身体健康、无异常&jrJccry.dm=01&jrJccry1=未接触传染源&jkm=&jkm1=&xcm=&xcm1=&xgym=&xgym1=&hsjc=&hsjc1=&bz=&operationType=Create&dm="
res = requests.get(url_search_call,headers=headers)
print(res.text)
pass

'''
报头signature 在应用中生成
通过签名获取校验码最后获取cooki===》JSESSIONID
'''